package Concurrency2.Inteview01_ThreadPool.version03;

import Concurrency2.Inteview01_ThreadPool.version01.ThreadPool;

import java.util.concurrent.atomic.AtomicInteger;

public class LoggerPolicy implements RejectedExecutionHandler {
    private static AtomicInteger taskQuantity = new AtomicInteger();

    @Override
    public void rejectedExecution(Runnable task, ThreadPool executor) {
        System.out.println("拒绝策略: 记录 " + taskQuantity.incrementAndGet() + " 个Task到日志");
    }
}
